/* 
 * File:   structs.h
 * Author: cbender
 *
 * Created on 27. August 2014, 12:09
 */

#ifndef STRUCTS_H
#define	STRUCTS_H

#include <oclUtils.h>

#define CONFIG_USE_DOUBLE 1
#if CONFIG_USE_DOUBLE

// double
typedef cl_double cl_real_t;

#else

// float
typedef cl_float cl_real_t;

#endif

// elements for old cpu impl
struct isotope{
  struct isotope *next=NULL,*previous=NULL;
  cl_double p;
  cl_double mass;
};

struct compound {
  struct compound *next=NULL,*previous=NULL;
  cl_int amount;
  struct isotope *isotopes;
};

struct clcomplex {
    cl_real_t real; 
    cl_real_t imaginary;
};

struct input_data{
            cl_int id;
            cl_int mode;
            cl_real_t C12;
            cl_real_t  C13;
            cl_real_t  H1;
            cl_real_t  H2;
            cl_real_t  N14;
            cl_real_t  N15;
            cl_real_t  O16;
            cl_real_t  O17;
            cl_real_t  O18;
            cl_real_t  P31;
            cl_real_t  S32;
            cl_real_t  S33;
            cl_real_t  S34;
            cl_real_t  S36;
            cl_int numC;
            cl_int numH;
            cl_int numN;
            cl_int numO;
            cl_int numP;
            cl_int numS;
            cl_real_t accuracy;
};

struct gpu_input_data {
    cl_real_t molecularWeight;
    cl_real_t minMolecularWeight;         
    cl_int maxIntIsoShiftAsInt;           
    cl_real_t integerMolecularWeight;      
    cl_int integerMolecularWeightAsInt;    
    cl_int minIntegerMolecularWeightAsInt;
    cl_int maxIntegerMolecularWeightAsInt; 
    cl_real_t molecularVariance;         
    cl_real_t integerMolecularVariance;   
    cl_long massRange;
    cl_long numPoints;
    cl_int resolution;
    cl_int bitSize;
};

// mass definitions
#define C12_MASS 12.0000000
#define C13_MASS 13.0033548378
#define C12_INT_MASS 12
#define C13_INT_MASS 13
#define H1_MASS 1.0078250321
#define H2_MASS 2.0141017780
#define H1_INT_MASS 1
#define H2_INT_MASS 2
#define N14_MASS 14.0030740052
#define N15_MASS 15.0001088984
#define N14_INT_MASS 14
#define N15_INT_MASS 15
#define O16_MASS 15.9949146221
#define O17_MASS 16.99913150
#define O18_MASS 17.9991604
#define O16_INT_MASS 16
#define O17_INT_MASS 17
#define O18_INT_MASS 18
#define P31_MASS 30.97376151
#define P31_INT_MASS 31
#define S32_MASS 31.97207069
#define S33_MASS 32.97145850
#define S34_MASS 33.96786683
#define S36_MASS 35.96708088
#define S32_INT_MASS 32
#define S33_INT_MASS 33
#define S34_INT_MASS 34
#define S36_INT_MASS 36
#define ELECTRON_MASS 0.00054857990946
#define PROTON_MASS   1.007276466812

#endif	/* STRUCTS_H */

